{% extends 'base.html' %}
{% load static %}
{% block title %}测试集合执行结果{% endblock %}
{% block content %}
<div class="table-responsive">
    <table class="table table-striped">
        <thead>
        <tr>
            <th>id</th>
            <th>测试集合名称</th>
            <th>延迟执行时间</th>
            <th>执行状态</th>
            <th>测试结果</th>
            <th>创建者</th>
            <th>创建时间</th>

        </tr>
        </thead>
        <tbody>
        {% for case_suite_execute_record in case_suite_execute_records %}
        <tr>
            <td><a href="{% url 'suite_case_execute_record' case_suite_execute_record.id %}">{{ case_suite_execute_record.id }}</a></td>
            <td>{{ case_suite_execute_record.case_suite.suite_desc}}</td>
            <td>{{ case_suite_execute_record.run_time_inrerval }}</td>
            {% if case_suite_execute_record.status %}
            <td>执行完毕</td>
                {% else %}
            <td>待执行</td>
            {% endif %}
            {% ifequal case_suite_execute_record.test_result '成功' %}
            <td bgcolor="green">{{ case_suite_execute_record.test_result }}</td>
            {% else %}
        <td bgcolor="red">{{ case_suite_execute_record.test_result }}</td>
        {% endifequal %}
        <a href="{% url 'suite_case_statistic' case_suite_execute_record.id %}"></a>
         <!--  <td>{{ case_suite_execute_record.test_result|default_if_none:""}}</td>-->
            <td>{{ case_suite_execute_record.creator }}</td>
            <td>{{ case_suite_execute_record.create_time|date:"Y-n-d H:i"}}</td>
        </tr>
        {% endfor %}
        </tbody>
    </table>
</div>
<div id="pages" class="text-center">
    <nav>
        <ul class="pagination">
            <li class="step-links">
               {% if case_suite_execute_records.has_next %}
                <a class="active" href="?page={{ case_suite_execute_records.previous_page_number }}">上一页</a>
                {% endif %}
            <span class="current">第 {{ case_suite_execute_records.number }} 页 / 共 {{ case_suite_execute_records.num_pages }} 页</span>
            {% if case_suite_execute_records.has_next %}
            <a class="active" href="?page={{ case_suite_execute_records.next_page_number }}">下一页</a>
            {% endif %}
            </li>
        </ul>
    </nav>
</div>
{% endblock %}